/**
 * Licensee: DuKe TeAm
 * License Type: Purchased
 */
package ormsamples;

import org.orm.*;
public class ListTransaccionesPruebaIIData {
	private static final int ROW_COUNT = 100;
	
	public void listTestData() throws PersistentException {
		System.out.println("Listing Transaccion...");
		orm_transaccion.Transaccion[] orm_transaccionTransaccions = orm_transaccion.TransaccionDAO.listTransaccionByQuery(null, null);
		int length = Math.min(orm_transaccionTransaccions.length, ROW_COUNT);
		for (int i = 0; i < length; i++) {
			System.out.println(orm_transaccionTransaccions[i]);
		}
		System.out.println(length + " record(s) retrieved.");
		
	}
	
	public void listByCriteria() throws PersistentException  {
		System.out.println("Listing Transaccion by Criteria...");
		orm_transaccion.TransaccionCriteria transaccionCriteria = new orm_transaccion.TransaccionCriteria();
		// Please uncomment the follow line and fill in parameter(s) 
		//transaccionCriteria.id_transaccion.eq();
		transaccionCriteria.setMaxResults(ROW_COUNT);
		orm_transaccion.Transaccion[] orm_transaccionTransaccions = transaccionCriteria.listTransaccion();
		int length =orm_transaccionTransaccions== null ? 0 : Math.min(orm_transaccionTransaccions.length, ROW_COUNT); 
		for (int i = 0; i < length; i++) {
			 System.out.println(orm_transaccionTransaccions[i]);
		}
		System.out.println(length + " Transaccion record(s) retrieved."); 
		
	}
	
	public static void main(String[] args) {
		try {
			ListTransaccionesPruebaIIData listTransaccionesPruebaIIData = new ListTransaccionesPruebaIIData();
			try {
				listTransaccionesPruebaIIData.listTestData();
				//listTransaccionesPruebaIIData.listByCriteria();
			}
			finally {
				orm_transaccion.TransaccionesPruebaIIPersistentManager.instance().disposePersistentManager();
			}
		}
		catch (Exception e) {
			e.printStackTrace();
		}
	}
}
